/**
  * Copyright 2019 bejson.com 
  */
package com.xingkeduo.dto.transter.order;

import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.time.ZoneOffset;

@Data
public class Queue {

    private String f_id;
    private String f_order_no;
    private String f_user_id;
    private String f_store_id;
    private String f_row_no;
    private String f_shout_times;
    private String f_status;
    private String f_is_send_two_times;
    private String f_is_send_five_times;
    private String f_appointment_time;
    private String f_createtime;
    private String f_test;
    private String f_is_passed;
    private String f_type;
    private String f_ticket_no;
    private String f_mode;
    private String f_first_shout_time;
    private String f_second_shout_time;
    private String f_passed_time;
    private String f_expect_time;
    private String f_queue_type;
    private String f_is_first_remind;
    private String f_is_second_remind;
    private String f_expiration_time;

    public void covert(OrderUserResponseDto orderUserResponseDto) {
      this.f_id = String.valueOf(orderUserResponseDto.getId());
      this.f_order_no = orderUserResponseDto.getOrderNo();
      this.f_user_id = String.valueOf(orderUserResponseDto.getUserId());
      this.f_store_id =  String.valueOf(orderUserResponseDto.getStoreId());
      this.f_row_no = orderUserResponseDto.getWaitingLineNo();
      this.f_shout_times= orderUserResponseDto.getAnnounceNumberTimes()!=null?String.valueOf(orderUserResponseDto.getAnnounceNumberTimes().split(",").length):null;
      this.f_status = "1";
      this.f_is_send_two_times = "0";
      this.f_is_send_five_times = "0";
      if(orderUserResponseDto.getAppointmentStartTime()!=null){
          this.f_appointment_time = String.valueOf(orderUserResponseDto.getAppointmentStartTime().toEpochSecond(ZoneOffset.of("+8")));
      }
     
      this.f_createtime =  String.valueOf(orderUserResponseDto.getCreatedTime().toEpochSecond(ZoneOffset.of("+8")));
      this.f_test = "0";
      this.f_is_passed = "0";
      this.f_type = "1";
      this.f_ticket_no = orderUserResponseDto.getTicketCode();
      this.f_mode = "2";
      this.f_first_shout_time = null;
      this.f_second_shout_time = null;
      this.f_passed_time = null;
      this.f_expect_time = "0";
      this.f_queue_type="1";
      this.f_is_first_remind = "0";
      this.f_is_second_remind = "0";
      this.f_expiration_time ="0";

    }
}